﻿-- =============================================
-- Author:		Andreas Könighofer (IT-eXperience)
-- Create date: 14.01.2009
-- Description:	Updates existing RentalService.
-- =============================================
CREATE PROCEDURE [dbo].[UpdateRentalService]
	-- Add the parameters for the stored procedure here
	@RentalServiceID INT
	, @StartDate SMALLDATETIME = NULL
	, @EndDate SMALLDATETIME = NULL
	, @ReturnedDate SMALLDATETIME = NULL
	, @ResourceID INT = NULL
	, @CustomerID INT = NULL
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    UPDATE [BigDays2009].[dbo].[RentalService]
   SET [StartDate] = ISNULL(@StartDate, StartDate)
      ,[EndDate] = ISNULL(@EndDate, EndDate)
      ,[ReturnedDate] = ISNULL(@ReturnedDate, ReturnedDate)
      ,[ResourceID] = ISNULL(@ResourceID, ResourceID)
      ,[CustomerID] = ISNULL(@CustomerID, CustomerID)
	WHERE RentalServiceID = @RentalServiceID
END

---- end script UpdateRentalService stored procedure ----

---- start script UpdateResource stored procedure ----

